<!DOCTYPE html>
<html class="client-nojs vector-feature-night-mode-disabled vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-sticky-header-enabled" lang="en" dir="ltr"><head>
<meta charset="UTF-8">
<title>Distributed SQL</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="canonical" href="https://en.wikipedia.org/wiki/Distributed_SQL"> <link href="./mw/ext.cite.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.icons.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/user.styles.css" rel="stylesheet" type="text/css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" type="text/css" href="./mw/site.styles.css">
<link rel="stylesheet" type="text/css" href="./mw/noscript.css">
<link rel="stylesheet" type="text/css" href="./footer.css">
<link rel="stylesheet" type="text/css" href="./vector-2022.css">
</head>
<body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Distributed_SQL rootpage-Distributed_SQL skin-vector-2022 action-view">
<div class="mw-page-container">
<div class="mw-page-container-inner">
<div class="mw-content-container">
<main id="content" class="mw-body">
<header class="mw-body-header vector-page-titlebar">
<h1 id="firstHeading" class="firstHeading mw-first-heading">
<span id="openzim-page-title" class="mw-page-title-main"><span class="mw-page-title-main">Distributed SQL</span></span>
</h1>
</header>
<a id="top"></a>
<div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
<div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="en" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr">
<p>A <b>distributed SQL</b> database is a single <a href="Relational_database" title="Relational database">relational database</a> which replicates data across multiple servers. Distributed SQL databases are strongly consistent and most support consistency across racks, data centers, and <a href="Wide_area_network" title="Wide area network">wide area networks</a> including cloud availability zones and cloud geographic zones. Distributed SQL databases typically use the <a href="Paxos_(computer_science)" title="Paxos (computer science)">Paxos</a> or <a href="Raft_(algorithm)" title="Raft (algorithm)">Raft</a> algorithms to achieve <a href="Consensus_decision-making" title="Consensus decision-making">consensus</a> across multiple nodes.
</p><p>Sometimes distributed SQL databases are referred to as <a href="NewSQL" title="NewSQL">NewSQL</a> but NewSQL is a more inclusive term that includes databases that are not <a href="Distributed_databases" class="mw-redirect" title="Distributed databases">distributed databases</a>.
</p>
<meta property="mw:PageProp/toc">
<div class="mw-heading mw-heading2"><h2 id="History">History</h2></div>
<p><a href="Google" title="Google">Google</a>'s <a href="Spanner_(database)" title="Spanner (database)">Spanner</a> popularized the modern distributed SQL database concept. Google described the database and its architecture in a 2012 whitepaper called "Spanner: Google's Globally-Distributed Database." The paper described Spanner as having evolved from a <a href="Big_Table" class="mw-redirect" title="Big Table">Big Table</a>-like <a href="Key_value" class="mw-redirect" title="Key value">key value</a> store into a temporal multi-version database where data is stored in "schematized semi-relational tables."<sup id="cite_ref-autogenerated1_1-0" class="reference"><a href="#cite_note-autogenerated1-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup>
</p><p>Spanner uses atomic clocks with the Paxos algorithm to accomplish consensus with regards to state distributed between servers. In 2010, and earlier implementation, <a href="Clustrix" title="Clustrix">ClustrixDB</a> (now <a href="MariaDB" title="MariaDB">MariaDB</a> Xpand) moved from a hardware appliance to a Paxos-based software database<sup id="cite_ref-2" class="reference"><a href="#cite_note-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup> and was later acquired by <a href="MariaDB" title="MariaDB">MariaDB</a><sup id="cite_ref-3" class="reference"><a href="#cite_note-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup> and added to a <a href="SaaS" class="mw-redirect" title="SaaS">SaaS</a> cloud offering called <a href="MariaDB#SkySQL" title="MariaDB">SkySQL</a>.<sup id="cite_ref-4" class="reference"><a href="#cite_note-4"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup> In 2015, two Google engineers left the company to create <a href="Cockroach_Labs" class="mw-redirect" title="Cockroach Labs">Cockroach DB</a> which achieves similar results using the Raft algorithm without atomic clocks or custom hardware.<sup id="cite_ref-5" class="reference"><a href="#cite_note-5"><span class="cite-bracket">[</span>5<span class="cite-bracket">]</span></a></sup>
</p><p>Spanner is primarily used for transactional and time-series use cases. However, Google furthered this research with a follow on paper about Google F1 which it describes as a <a href="Hybrid_transactional/analytical_processing" title="Hybrid transactional/analytical processing">Hybrid transactional/analytical processing</a> database built on Spanner.<sup id="cite_ref-autogenerated1_1-1" class="reference"><a href="#cite_note-autogenerated1-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading2"><h2 id="Architecture">Architecture</h2></div>
<p>Distributed SQL databases have the following general characteristics:
</p>
<ul><li>synchronous replication</li>
<li>strong transactional consistency across at least availability zones (i.e. <a href="ACID" title="ACID">ACID</a> compliance)<sup id="cite_ref-6" class="reference"><a href="#cite_note-6"><span class="cite-bracket">[</span>6<span class="cite-bracket">]</span></a></sup></li>
<li>relational database front end structure – meaning data represented as tables with rows and columns similar to any other <a href="RDBMS" class="mw-redirect" title="RDBMS">RDBMS</a></li>
<li>automatically <a href="Shard_(database_architecture)" title="Shard (database architecture)">sharded</a> data storage</li>
<li>underlying key–value storage<sup id="cite_ref-7" class="reference"><a href="#cite_note-7"><span class="cite-bracket">[</span>7<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-autogenerated1_1-2" class="reference"><a href="#cite_note-autogenerated1-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup></li>
<li>native SQL implementation</li></ul>
<p>Following the <a href="CAP_Theorem" class="mw-redirect" title="CAP Theorem">CAP Theorem</a>, distributed SQL databases are "CP" or consistent and partition-tolerant. Algorithmically they sacrifice availability in that a failure of a primary node can make the database unavailable for writes.
</p><p>All distributed SQL implementations require some kind of temporal synchronization to guarantee consistency. With the exception of Spanner, most do not use custom hardware to provide atomic clocks. Spanner is able to synchronize writes with temporal guarantees. Implementations without custom hardware require servers to compare clock offsets and potentially retry reads.<sup id="cite_ref-8" class="reference"><a href="#cite_note-8"><span class="cite-bracket">[</span>8<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading2"><h2 id="Distributed_SQL_implementations">Distributed SQL implementations</h2></div>
<table class="wikitable sortable">
<tbody><tr>
<th>Vendor</th>
<th>API
</th>
<th>License model
</th></tr>
<tr>
<td><a href="Amazon_Aurora" title="Amazon Aurora">Amazon Aurora</a></td>
<td><a href="PostgreSQL" title="PostgreSQL">PostgreSQL</a> & <a href="MySQL" title="MySQL">MySQL</a>
</td>
<td>Proprietary
</td></tr>
<tr>
<td><a href="CockroachDB" title="CockroachDB">CockroachDB</a>
</td>
<td><a href="PostgreSQL" title="PostgreSQL">PostgreSQL</a>-like
</td>
<td>Proprietary
</td></tr>
<tr>
<td><a href="Spanner_(database)" title="Spanner (database)">Google Spanner</a></td>
<td>Proprietary SQL-like
</td>
<td>Proprietary
</td></tr>
<tr>
<td><a href="MySQL_Cluster" title="MySQL Cluster">MySQL Cluster</a></td>
<td><a href="MySQL" title="MySQL">MySQL</a>
</td>
<td>Open Source (GPLv2)
</td></tr>
<tr>
<td><a href="NuoDB" title="NuoDB">NuoDB</a></td>
<td>Proprietary SQL
</td>
<td>Proprietary
</td></tr>
<tr>
<td><a href="YugabyteDB" title="YugabyteDB">YugabyteDB</a></td>
<td><a href="PostgreSQL" title="PostgreSQL">PostgreSQL</a> & <a href="Apache_Cassandra" title="Apache Cassandra">Cassandra</a> CQL-like
</td>
<td>Open Source (Apache 2.0)
</td></tr>
<tr>
<td><a href="TiDB" title="TiDB">TiDB</a>
</td>
<td><a href="MySQL" title="MySQL">MySQL</a>-like
</td>
<td>Open Source (Apache 2.0)
</td></tr>
<tr>
<td><a href="MariaDB" title="MariaDB">MariaDB XPand</a>
</td>
<td><a href="MariaDB" title="MariaDB">MariaDB</a>
</td>
<td>Proprietary
</td></tr>
<tr>
<td><a href="Teradata" title="Teradata">Teradata</a></td>
<td>Proprietary SQL-like
</td>
<td>Proprietary
</td></tr>
<tr>
<td><a href="YDB_(database)" title="YDB (database)">YDB</a><sup id="cite_ref-9" class="reference"><a href="#cite_note-9"><span class="cite-bracket">[</span>9<span class="cite-bracket">]</span></a></sup></td>
<td>Proprietary SQL-like, <a href="PostgreSQL" title="PostgreSQL">PostgreSQL</a>-like
</td>
<td>Open Source (Apache 2.0)
</td></tr></tbody></table>
<div class="mw-heading mw-heading2"><h2 id="Compared_to_NewSQL">Compared to NewSQL</h2></div>
<p>CockroachDB, YugabyteDB and others have at times referred to themselves as <a href="NewSQL" title="NewSQL">NewSQL</a> databases. Some of the NewSQL databases have fundamentally different architectures, but were cited as examples of NewSQL by Matthew Aslett who coined the term.<sup id="cite_ref-10" class="reference"><a href="#cite_note-10"><span class="cite-bracket">[</span>10<span class="cite-bracket">]</span></a></sup> In essence, distributed SQL databases are built from the ground-up and NewSQL databases include replication and sharding technologies added to existing client-server relational databases like <a href="PostgreSQL" title="PostgreSQL">PostgreSQL</a>.<sup id="cite_ref-11" class="reference"><a href="#cite_note-11"><span class="cite-bracket">[</span>11<span class="cite-bracket">]</span></a></sup> Some experts define DistributedSQL databases as a more specific subset of NewSQL databases.<sup id="cite_ref-12" class="reference"><a href="#cite_note-12"><span class="cite-bracket">[</span>12<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading2"><h2 id="References">References</h2></div>
<div class="mw-references-wrap mw-references-columns"><ol class="references">
<li id="cite_note-autogenerated1-1"><span class="mw-cite-backlink">^ <a href="#cite_ref-autogenerated1_1-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-autogenerated1_1-1"><sup><i><b>b</b></i></sup></a> <a href="#cite_ref-autogenerated1_1-2"><sup><i><b>c</b></i></sup></a></span> <span class="reference-text"><a rel="nofollow" class="external free" href="https://storage.googleapis.com/pub-tools-public-publication-data/pdf/41344.pdf">https://storage.googleapis.com/pub-tools-public-publication-data/pdf/41344.pdf</a> </span>
</li>
<li id="cite_note-2"><span class="mw-cite-backlink"><b><a href="#cite_ref-2">^</a></b></span> <span class="reference-text"><style data-mw-deduplicate="TemplateStyles:r1238218222">
/* start https://en.wikipedia.org/ */
.mw-parser-output cite.citation{font-style:inherit;word-wrap:break-word}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .citation:target{background-color:rgba(0,127,255,0.133)}.mw-parser-output .id-lock-free.id-lock-free a{background:url("./mw/Lock-green.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-limited.id-lock-limited a,.mw-parser-output .id-lock-registration.id-lock-registration a{background:url("./mw/Lock-gray-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-subscription.id-lock-subscription a{background:url("./mw/Lock-red-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .cs1-ws-icon a{background:url("./mw/Wikisource-logo.svg")right 0.1em center/12px no-repeat}body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-free a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-limited a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-registration a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-subscription a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .cs1-ws-icon a{background-size:contain;padding:0 1em 0 0}.mw-parser-output .cs1-code{color:inherit;background:inherit;border:none;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;color:var(--color-error,#d33)}.mw-parser-output .cs1-visible-error{color:var(--color-error,#d33)}.mw-parser-output .cs1-maint{display:none;color:#085;margin-left:0.3em}.mw-parser-output .cs1-kern-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right{padding-right:0.2em}.mw-parser-output .citation .mw-selflink{font-weight:inherit}@media screen{.mw-parser-output .cs1-format{font-size:95%}html.skin-theme-clientpref-night .mw-parser-output .cs1-maint{color:#18911f}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .cs1-maint{color:#18911f}}
/* end https://en.wikipedia.org/ */
</style><cite id="CITEREFHigginbotham2010" class="citation web cs1">Higginbotham, Stacey (May 3, 2010). <a rel="nofollow" class="external text" href="https://gigaom.com/2010/05/03/clustrix-builds-the-webscale-holy-grail-a-database-that-scales/,%20https://gigaom.com/2010/05/03/clustrix-builds-the-webscale-holy-grail-a-database-that-scales/">"Clustrix Builds the Webscale Holy Grail: A Database That Scales"</a>. <i>gigaom.com</i>.</cite></span>
</li>
<li id="cite_note-3"><span class="mw-cite-backlink"><b><a href="#cite_ref-3">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://techcrunch.com/2018/09/20/mariadb-acquires-clusterix/">"MariaDB acquires Clustrix"</a>. 20 September 2018.</cite></span>
</li>
<li id="cite_note-4"><span class="mw-cite-backlink"><b><a href="#cite_ref-4">^</a></b></span> <span class="reference-text"><cite id="CITEREFBaer_(dbInsight)" class="citation web cs1">Baer (dbInsight), Tony. <a rel="nofollow" class="external text" href="https://www.zdnet.com/article/for-mariadb-its-time-to-put-the-pieces-together/">"For MariaDB, it's time to put the pieces together"</a>. <i>ZDNet</i>.</cite></span>
</li>
<li id="cite_note-5"><span class="mw-cite-backlink"><b><a href="#cite_ref-5">^</a></b></span> <span class="reference-text"><cite id="CITEREFMorgan2017" class="citation web cs1">Morgan, Timothy Prickett (February 22, 2017). <a rel="nofollow" class="external text" href="https://www.nextplatform.com/2017/02/22/google-spanner-inspires-cockroachdb-outrun/">"Google Spanner Inspires CockroachDB To Outrun It"</a>. <i>The Next Platform</i>.</cite></span>
</li>
<li id="cite_note-6"><span class="mw-cite-backlink"><b><a href="#cite_ref-6">^</a></b></span> <span class="reference-text"><cite class="citation cs2"><a rel="nofollow" class="external text" href="https://www.youtube.com/watch?v=3igIRQqmYc4"><i>The future of databases: distributed SQL & MariaDB ®</i></a><span class="reference-accessdate">, retrieved <span class="nowrap">2022-12-21</span></span></cite></span>
</li>
<li id="cite_note-7"><span class="mw-cite-backlink"><b><a href="#cite_ref-7">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://www.youtube.com/watch?v=avOgswXxayA">"The Architecture of a Distributed SQL Database"</a>. 23 September 2020 – via www.youtube.com.</cite></span>
</li>
<li id="cite_note-8"><span class="mw-cite-backlink"><b><a href="#cite_ref-8">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://www.cockroachlabs.com/blog/living-without-atomic-clocks/">"Living Without Atomic Clocks"</a>. <i>Cockroach Labs</i>. April 21, 2020.</cite></span>
</li>
<li id="cite_note-9"><span class="mw-cite-backlink"><b><a href="#cite_ref-9">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://ydb.tech">"YDB is an open-source Distributed SQL Database that combines high availability and scalability with strong consistency and ACID transactions"</a>. <i>ydb.tech</i>.</cite></span>
</li>
<li id="cite_note-10"><span class="mw-cite-backlink"><b><a href="#cite_ref-10">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://blogs.451research.com/information_management/2011/04/06/what-we-talk-about-when-we-talk-about-newsql/">"What we talk about when we talk about NewSQL — Too much information"</a>.</cite></span>
</li>
<li id="cite_note-11"><span class="mw-cite-backlink"><b><a href="#cite_ref-11">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://www.ibm.com/cloud/blog/sql-vs-nosql">"SQL vs. NoSQL Databases: What's the Difference?"</a>. <i>www.ibm.com</i>. 12 June 2022.</cite></span>
</li>
<li id="cite_note-12"><span class="mw-cite-backlink"><b><a href="#cite_ref-12">^</a></b></span> <span class="reference-text"><cite id="CITEREFPrabagaren2019" class="citation web cs1">Prabagaren, Gokul (October 30, 2019). <a rel="nofollow" class="external text" href="https://medium.com/capital-one-tech/newsql-the-next-evolution-in-databases-19109973ee53">"NewSQL — The Next Evolution in Databases"</a>. <i>Medium</i>.</cite></span>
</li>
</ol></div></div><!--htdig_noindex--><div><div class="zim-footer">
This article is issued from <a class="external text" title="Last edited on 2025-07-06" href="https://en.wikipedia.org/wiki/?title=Distributed_SQL&oldid=1299088859">Wikipedia</a>. The text is available under <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en">Creative Commons Attribution-Share Alike 4.0</a> unless otherwise noted. Additional terms may apply for the media files.
</div>
</div><!--/htdig_noindex--></div>
</div>
</main>
</div>
</div>
</div>
</body></html>